package io.gitee.hechenl.datamultitrans.mqtt;

import lombok.Data;
import org.eclipse.paho.client.mqttv3.MqttCallback;

@Data
public class InitClient {

    private String clientId;
    private Boolean cleanSession;

    private String brokeAddress;
    private String brokeUserName;
    private String brokePassword;

    private MqttCallback callback;

    private String pubTopic;
    private String subTopic;

    public InitClient(String clientId, Boolean cleanSession, MyBroker broker, String pubTopic, String subTopic, MqttCallback callback) {
        this.clientId = clientId;
        this.cleanSession = cleanSession;
        this.brokeAddress = broker.getAddress();
        this.brokeUserName = broker.getUserName();
        this.brokePassword = broker.getPassword();
        this.callback = callback;
        if (callback == null) {
            this.callback = new CallBackDefaultImpl(null);
        }
        this.pubTopic = pubTopic;
        this.subTopic = subTopic;
    }
}
